//
// Student 1 Name, ID.  SuJiani,20242996
// Student 2 Name, ID.
// Student 3 Name, ID.
//

#include "Book.h"

// Book.cpp
#include <stdexcept>

Book::Book(const std::string& t, const std::string& a, int y, const std::string& i)
    : title(t), author(a), yearOfPublication(y), isbn(i) 
{
    if (y < 0) 
    {
        throw std::invalid_argument("Year of publication cannot be negative.");
    }
}

std::string Book::getTitle() const
{
    return title;
}

std::string Book::getAuthor() const 
{
    return author;
}

int Book::getYearOfPublication() const 
{
    return yearOfPublication;
}

std::string Book::getISBN() const
{
    return isbn;
}

void Book::setTitle(const std::string& t) 
{
    title = t;
}

void Book::setAuthor(const std::string& a) 
{
    author = a;
}

void Book::setYearOfPublication(int y) 
{
    if (y < 0) {
        throw std::invalid_argument("Year of publication cannot be negative.");
    }
    yearOfPublication = y;
}

void Book::setISBN(const std::string& i)
{
    isbn = i;
}